{% extends 'base.html' %}

{% block title %}管理员登录 - AI故事生成系统{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card shadow-lg mt-5">
                <div class="card-header bg-primary text-white">
                    <h4 class="mb-0">管理员登录</h4>
                </div>
                <div class="card-body">
                    <form method="post">
                        {% csrf_token %}
                        <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
                        <div class="alert alert-warning">
                            <i class="bi bi-exclamation-triangle-fill me-2"></i>
                            注意：此页面仅供系统管理员使用，普通用户请使用<a href="{% url 'user:login' %}" class="alert-link">普通用户登录页面</a>。
                        </div>
                        
                        <div class="mb-3">
                            <label for="id_username" class="form-label">用户名</label>
                            <input type="text" name="username" class="form-control {% if form.username.errors %}is-invalid{% endif %}" 
                                   id="id_username" placeholder="输入管理员用户名" required>
                            {% if form.username.errors %}
                            <div class="invalid-feedback">
                                {{ form.username.errors|join:", " }}
                            </div>
                            {% endif %}
                        </div>
                        
                        <div class="mb-3">
                            <label for="id_password" class="form-label">密码</label>
                            <input type="password" name="password" class="form-control {% if form.password.errors %}is-invalid{% endif %}" 
                                   id="id_password" placeholder="输入管理员密码" required>
                            {% if form.password.errors %}
                            <div class="invalid-feedback">
                                {{ form.password.errors|join:", " }}
                            </div>
                            {% endif %}
                        </div>
                        
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">
                                <i class="bi bi-shield-lock me-1"></i> 管理员登录
                            </button>
                            <a href="/" class="btn btn-outline-secondary">返回首页</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 